Vue.component('aui-truncate-text', {
    template: `
        <div :title="data.value">{{showstr}}</div>
    `,
    props: {
        data: {
            type: Object
        }
    },
    computed: {
        showstr() {
            var self = this;
            var len = 1000;
            var start = 0;
            if (self.data.len) {
                len = self.data.len;
            }
            if (self.data.value ) {
                if (len < self.data.value.length) {
                    return self.data.value.substring(start, len) + "...";
                } else {
                    return self.data.value.substring(start, len);
                }
            }
            return "";
        }
    },
    data: function() {
        return {
        }
    },
    mounted() {
        var self = this;
    }
});

Vue.component('aui-enums-translate', {
    template: `
        <div v-html="showstr"></div>
    `,
    props: {
        data: {
            type: Object
        }
    },
    computed: {
        showstr() {
            var self = this;
            return rootcontroller.getItemFromEnumByValue(self.data.enums, self.data.value).label;
        }
    },
    data: function() {
        return {
        }
    },
    mounted() {
        var self = this;
    }
});

Vue.component('aui-overflow-text', {
    template: `
        <div class="aui-overflow-text" :title="data.value">{{showstr}}</div>
    `,
    props: {
        data: {
            type: Object
        }
    },
    computed: {
        showstr() {
            var self = this;
            var len = 1000;
            var start = 0;
            if (self.data.len) {
                len = self.data.len;
            }
            if (self.data.value ) {
                if (len < self.data.value.length) {
                    return self.data.value.substring(start, len) + "...";
                } else {
                    return self.data.value.substring(start, len);
                }
            }
            return "";
        }
    },
    data: function() {
        return {
        }
    },
    mounted() {
        var self = this;
    }
});